﻿using System;
using Report.Properties;
using Report.Service;

namespace Report.Engine
{
    public class EndStep : IExportStep
    {
        public ExecuteResult Execute(ExportContext context)
        {
            string docName = ReportApplication.MapPath(string.Format("客户名称gomez性能测试报告{0}（jpg）.doc", DateTime.Now.ToString("yyyyMMdd")));

            WordProcessor wordProcessor = context.WordProcessor;

            if (Settings.Default.AutoOpen)
            {
                wordProcessor.SaveAndShow(docName);
            }
            else
            {
                wordProcessor.SaveAndQuit(docName);
            }
            return ExecuteResult.Close;
        }
    }
}
